home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 18
/
AMIGAplus Sonderheft 18 (1999)(ICP)(DE)[!].iso
/
PD
/
Anwendungen
/
ppclibemu
/
README
< prev
next >
Wrap
Text File
|
1999-01-03
|
8KB
|
242 lines
---------- ppclibemu V0.4a - The ppc.library emulation for WarpOS ----------
INTRODUCTION
This is the first try for an emulation of the PowerUp-ppc.library
under WarpOS. It's not even alpha, it's a very early pre-release
with only the most important functions implemented. My main in-
tention in this release was to show that emulation is possible.
Emulation of the whole ppc.library messaging system is still
missing, so you are limited to simple ELF objects, which may either
be started by SAS/C's runelf or Ralph Schmidt's PPCLoad. You cannot
take vbcc's PPCRun, for example, because it uses startup-messages.
The following functions of the original ppc.library are supported:
o PPCLoadObject
o PPCUnLoadObject
o PPCRunObject
o PPCAllocMem (MEMF_NOCACHESYNCxxx not supported)
o PPCFreeMem
o PPCAllocVec (MEMF_NOCACHESYNCxxx not supported)
o PPCFreeVec
o PPCDebugMode (private, doesn't work like the original)
o PPCCreateTask (only synchronous tasks)
o PPCGetAttrs (PPCINFOTAG_EXCEPTIONHOOK not supported)
o PPCReadLong
o PPCWriteLong
o PPCGetObjectAttrs
o PPCWriteLongFlush
o PPCReadWord
o PPCWriteWord
o PPCReadByte
o PPCWriteByte
o PPCLoadObjectTagList
The following functions of the original PowerUp kernel are supported:
o PPCAdd64
o PPCAdd64p
o PPCAddHead
o PPCAddHeadSync (implementation may be incorrect)
o PPCAddTail
o PPCAddTailSync (implementation may be incorrect)
o PPCAllocMem (NOCACHESYNCM68K simulated by allocating chip RAM)
o PPCAllocPooled (No pooled mem under WOS, same as PPCAllocMem)
o PPCAllocVec (NOCACHESYNCM68K simulated by allocating chip RAM)
o PPCAllocVecPooled (No pooled mem under WOS, same as PPCAllocVec)
o PPCAnd64
o PPCAnd64p
o PPCAsl64
o PPCAsl64p
o PPCAsr64
o PPCAsr64p
o PPCCallM68k (Flags ignored. Asynchronous calls are synchronous.)
o PPCCallOS (Flags ignored. Asynchronous calls are synchronous.)
o PPCClose
o PPCCmp64
o PPCCmp64p
o PPCCreatePool (No pooled mem under WOS, returns dummy)
o PPCDeletePool (Dummy. No pooled mem under WOS)
o PPCDivRem64
o PPCDivRem64p
o PPCDivs64
o PPCDivs64p
o PPCDivu64
o PPCDivu64p
o PPCEnqueue
o PPCEnqueueSync (implementation may be incorrect)
o PPCFreeMem
o PPCFreePooled (No pooled mem under WOS, same as PPCFreeMem)
o PPCFreeVec
o PPCFreeVecPooled (No pooled mem under WOS, same as PPCFreeVec)
o PPCInsert
o PPCInsertSync (implementation may be incorrect)
o PPCLsl64
o PPCLsl64p
o PPCLsr64
o PPCLsr64p
o PPCMods64
o PPCMods64p
o PPCModu64
o PPCModu64p
o PPCMuls64
o PPCMuls64p
o PPCMulu64
o PPCMulu64p
o PPCNeg64
o PPCNeg64p
o PPCNewList
o PPCNextTagItem
o PPCOpen
o PPCOr64
o PPCOr64p
o PPCRead
o PPCRemHead
o PPCRemHeadSync (implementation may be incorrect)
o PPCRemove
o PPCRemoveSync (implementation may be incorrect)
o PPCRemTail
o PPCRemTailSync (implementation may be incorrect)
o PPCSeek
o PPCSub64
o PPCSub64p
o PPCWrite
o PPCXor64
o PPCXor64p
o memcpy
o strcmp
o strcpy
o strlen
o __adddi3
o __anddi3
o __ashldi3
o __ashrdi3
o __cmpdi2
o __divdi3
o __fixdfdi
o __fixsfdi
o __fixunsdfdi
o __fixunssfdi
o __floatdidf
o __floatdisf
o __floatunsdidf
o __iordi3
o __lmulq
o __lshldi3
o __lshrdi3
o __moddi3
o __muldi3
o __negdi2
o __qdivrem
o __subdi3
o __ucmpdi2
o __udivdi3
o __umoddi3
o __xordi3
Unimplemented M68k functions will return with d0=0 and PPC
functions return with r3=0.
REQUIREMENTS
o 68040 or 68060
o CyberstormPPC, maybe BlizzardPPC
o WarpOS with powerpc.library V14
o runelf or PPCLoad
I've never seen a BPPC, so I can't guarantee that it works, but I
expect problems with disabling the original ppc.library, which is
loaded very early on those systems. I would suggest to use the
normal WarpOS-termination functionality to remove the original
library from the system. Then you should be able to use the emula-
tion library. If anyone has experience with the BPPC, please mail me.
INSTALLATION
If you want, save your original ppc.library:
> copy libs:ppc.library libs:ppc.library.orig
Copy the ppc.library emulation from this directory to libs:
> copy ppc.library libs:
The powerpc.library has to be patched. Otherwise it will prevent
the ppc.library from opening. The patch was tested with power-
pc.library 14.6 (16.07.98), but it should work for other versions
too:
> repl libs:powerpc.library "ppc.library\0warp" "xxx.library\0warp"
libs:powerpc.library: Replacement at 0x16820
1 replacement(s) in libs:powerpc.library.
Optionally, all these steps can be done automatically, be executing
the INSTALL script:
> execute INSTALL
Reboot your system to flush the old ppc.library and/or load the
patched powerpc.library.
USAGE
For a check, you might want to try the supplied test ELF object,
which was compiled by vbcc-ppc:
> runelf hello_world.elf
Hello World!
The other program in "tests/" is objattr_demo, a 68k program for
testing the PPCGetObjectAttrs() function. For example, you can
try to list all symbols of hello_world.elf:
> objattr_demo hello_world.elf
0x00000000 0x00000000
0x00000000 0x00000000
0x00000000 0x00000000
0x00000000 0x00000000
0x00000000 0x00000000
0x00000110 0x00000000 __error
0x000001F8 0x00000100 parse_cli_args
[...]
I know for sure that all ELF objects generated by vbcc-ppc, which
don't use any messaging, work very well. The same should apply to
gcc and SAS/C. I tested the following programs with succcess:
o ADoomPPC (don't forget to setenv DOOMWADDIR)
o VDoom (PPCLoad only - old startup code doesn't support runelf)
o Some demos: VAEDies and VAGhost (newer VA-demos don't work,
because they use the still unsupported PPC-TimerObjects)
o vbcc, vlink, pasm, etc. (all of my own utilities) compiled for
PPC-ELF.
BUGS
Most functions of ppc.library and PowerUp kernel are simply not
supported, so I'm not interested in bug reports saying: "xyz
crashes, maybe it calls an unsupported function...".
If you get any difficulties (I'm sure you will :), then try to
isolate the problem by enabling the debugging mode. The utility
ppcdbmode activates the internal debugging facilities of the emu-
lation library. Two bits are currently valid:
ppcdbmode 1 - enables all error requesters
ppcdbmode 0x8000 - enables serial debugging (you can use Sushi)
Or ppcdbmode 0x8001 to enable both. The serial debugging will mainly
print informations from the M68k part (the ppc.library). Serial
debugging for the kernel is possible by exchanging the ppc.library
by ppc.library.debug. Then you will additionally get debugging info
for each kernel function being called.
If you think that you found a bug, then send me the last lines of
this serial debugging output. You should be able to determine by
yourself, if it's a real bug or only an unimplemented function
which causes the problems.
Merry Christmas! :)
Frank Wille 20-Dec-1998 frank@phoenix.owl.de